<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>订单确认-一元夺宝</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<include file="public/comm" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav fs_xl">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">订单确认</h1>
		</header>
		<div class="mui-content fs_xl">
			<form action="{:U('Mobile/Goods/indianaOrder')}" method="post" id="orderForm">
			<div class="db_hq">
				<div class="db_hq_tit fs_l">获取方式</div>
				<p class="fs_m">方式1：我们将在夺宝结束后，把中奖情况发送至你的手机<span>{$user.mobile}</span>，请注意查收！</p>
				<p class="fs_m">方式2：进入我一元夺宝>更多>我的夺宝 查看</p>
			</div>
			<div class="dd_qr">
				<div class="dd_tit">订单详情</div>
				<div class="dd_info cls">
					<div class="dd_info_lt">
						<img src="{$goods[goods_id]|goods_thum_images=400,400}" />
					</div>
					<div class="dd_info_rt">
						<p class="db_qs">第{$indiana.id}期夺宝活动</p>
						<p class="db_name">{$indiana.title}</p>
						<p class="db_yj">￥{$goods.shop_price}</p>
					</div>
				</div>
			</div>
			<div class="db_zf fs_xl" style="height: initial;line-height: 3.43em;">
				<p class="cls">
					<span class="fs_l" style="line-height: 3px;">夺宝次数</span>
					<span class="mui-numbox fs_l" data-numbox-min='1' data-numbox-max='{$indiana.stock_num}' style="margin-top: 0.6em;margin-left: 0.6em;float: right;height: 2.5em;">
						<button id="btn2" class="mui-btn mui-btn-numbox-minus fs_l" style="" type="button">-</button>
						<input id="box" class="mui-input-numbox fs_l" value="1" type="number" name="num" style="vertical-align: top;" />
						<button id="btn1" class="mui-btn mui-btn-numbox-plus fs_l" style="" type="button">+</button>
					</span>
				</p>
				<p><span class="fs_l">支付金额</span><span class="fs_xxs">¥<em class="fs_xxi">{$indiana.price}</em></span></p>
				<input type="hidden" name="order_amount" value="1" />
				<input type="hidden" name="indiana_id" value="{$indiana.id}" />
				<input type="hidden" name="address_id" value="832" />
			</div>
			<div class="db_pay fs_xl">
				<a class="submit-btn" onClick="ajax_submit_form('orderForm','{:U('Mobile/Goods/indianaOrder')}');">确认订单</a>
			</div>
			</form>
		</div>
		<script type="text/javascript">
			mui.init();
			$(".db_hq span").text($(".db_hq span").text().substring(0,3)+"****"+$(".db_hq span").text().substring(7,11)); 
			document.getElementById("btn1").addEventListener('tap', function(event){
				var price = $(".fs_xxi").text();
				var num = $("#box").val();
				num++;
				var total = {$indiana.price} * num;
				$("input[name=order_amount]").val(total);
				$(".fs_xxi").text(total);
			});
			document.getElementById("btn2").addEventListener('tap', function(event){
				var num = $("#box").val();
				num--;
				var total = {$indiana.price} * num;
				$("input[name=order_amount]").val(total);
				$(".fs_xxi").text(total);
			});
			
//			$(".submit-btn").click(function(){
//				$("#orderForm").submit();
//			});
		</script>
	</body>

</html>